package com.qijian.maindata.domain.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 工序工单派单人员对象
 *
 * @author qijian
 * @date 2021-10-09
 */

@Data
@ToString
public class ProcessOrderUsersDelayVo {
    @JsonSerialize(using = ToStringSerializer.class)
    private Long wuId;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long workId;
    @Excel(name = "作业人员", sort = 11)
    private String userNickName;
    @Excel(name = "工单工时", sort = 8)
    private BigDecimal times;
    @Excel(name = "工单定额", sort = 9)
    private BigDecimal prices;
    @Excel(name = "实际工时", sort = 15)
    private BigDecimal actualTimes;
    private Date createTime;
    @Excel(name = "状态", readConverterExp = "0=完成,1=待接单,2=已接单,3=停机待料,4=待验收", sort = 12, defaultValue = "待派单")
    private Integer status;
    private Date checkTime;
    private Integer checkVal;
    @Excel(name = "工单管理人", sort = 7)
    private String workNickName;
    @Excel(name = "工单编号", sort = 5)
    private String workCode;
    private BigDecimal workCost;
    private BigDecimal workTime;
    private String workType;
    private String ncrCode;
    @Excel(name = "物料名称", sort = 4)
    private String itemName;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long processId;
    @Excel(name = "工序", sort = 6)
    private String processName;
    @Excel(name = "计划完成", sort = 10, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date workEndTime;
    private String projectNo;
    @Excel(name = "项目名称", sort = 2)
    private String projectName;
    private String machineNo;
    @Excel(name = "项目经理", sort = 3)
    private String projectNickName;
    private Date updateTime;
    private Integer level;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long bomId;
    @JsonSerialize(using = ToStringSerializer.class)
    private Long projectId;

    private Boolean isOut;

    @JSONField
    @Excel(name = "开工令", sort = 1)
    private String projectMachineNo;

    public String getProjectMachineNo() {
        return String.format("%s(%s#)", projectNo, machineNo);
    }
}
